package books.ThinkingInJava.src.Chapter5;

/**
 * @author bloodcolding
 * @version 1.0
 * @date 2/9/2020 11:46 AM
 * @apiNote
 */

public class ExplicitStaticInitialize {
    static int x;
    static String str;
    static String str2; //对照默认初始化

    {
        x = 110;
        str = "cold";
        str1 = "6666";     //变量的位置不影响初始化
    }

    int x1;
    String str3;

    {
        x1 = 555;
        str3 = "warm";
    }


    public ExplicitStaticInitialize() {
        System.out.println(x);
        System.out.println(str);
        System.out.println(str1);
        System.out.println(str2);

        System.out.println("_________________________________________");
        System.out.println(x1);
        System.out.println(str3);
    }

    static String str1;

    public static void main(String[] args) {
        ExplicitStaticInitialize ex = new ExplicitStaticInitialize();
    }
}
